#include "Transaction.h"

const char*  Transaction::TransactionType[5] = { "Salary", "Withdrawal", "Charge", "ATM", "COUNT" };

Transaction::Transaction(double transferMoney, eTransactionType typeOfTransacion,const Date& date)
	: transferedMoney(transferMoney), typeOfTransacion(typeOfTransacion), date(date)
{
}

double Transaction::getTransferedMoney()
{
	return transferedMoney;
}

Transaction::eTransactionType	Transaction::getTransactionType()
{
	return typeOfTransacion;
}

ostream& operator<<(ostream& os, const Transaction& t)
{

	os << "Transaction={Type=" << Transaction::TransactionType[t.typeOfTransacion] << " Amount=" << t.transferedMoney << " Date=" << t.date << "}";
	return os;
}

bool Transaction::operator==(const Transaction& other)	 const
{
	if (transferedMoney == other.transferedMoney)
	{
		return true;
	}

	return false;
}
		
Transaction::~Transaction()
{
}
